package com.haixiaoke.saas.order.mapper;

import cn.hutool.core.date.DateTime;
import com.haixiaoke.saas.order.domain.OrderLock;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;


public interface OrderLockMapper {
    /**
     * 查询订单锁单
     * 
     * @param lockId 订单锁单主键
     * @return 订单锁单
     */
    OrderLock selectOrderLockByLockId(Long lockId);

    /**
     * 查询订单锁单列表
     * 
     * @param orderLock 订单锁单
     * @return 订单锁单集合
     */
    List<OrderLock> selectOrderLockList(OrderLock orderLock);

    /**
     * 新增订单锁单
     * 
     * @param orderLock 订单锁单
     * @return 结果
     */
    int insertOrderLock(OrderLock orderLock);

    /**
     * 修改订单锁单
     * 
     * @param orderLock 订单锁单
     * @return 结果
     */
    int updateOrderLock(OrderLock orderLock);

    /**
     * 删除订单锁单
     * 
     * @param lockId 订单锁单主键
     * @return 结果
     */
    int deleteOrderLockByLockId(Long lockId);

    /**
     * 批量删除订单锁单
     * 
     * @param lockIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteOrderLockByLockIds(Long[] lockIds);

    /**
     * 查询退房时间比入住时间大的锁单数据
     * @param checkInTime
     * @param houseId
     * @return
     */
    List<OrderLock> selectOrderLockDateList(@Param("checkInTime") Date checkInTime,@Param("houseId") String houseId,@Param("orderId") String orderId);

    /**
     * 根据订单id删除数据
     * @param orderId
     * @return
     */
    int deleteOrderLockByOrderId(String orderId);

    List<OrderLock> selectOrderLockListByHouseId(@Param("houseId") String houseId,@Param("date") DateTime date);

    int updateOrderLockByOrderId(OrderLock lock);

    OrderLock selectOrderLockByOrderId(String orderId);
}
